home *** CD-ROM | disk | FTP | other *** search
/ Risc World 5 / Risc World 5.iso / SOFTWARE / Issue3 / Games / xrick / !xrick / src / c / scr_xrick < prev    next >
Text File  |  2004-06-24  |  1KB  |  75 lines

  1. /*
  2.  * xrick/src/scr_xrick.c
  3.  *
  4.  * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). All rights reserved.
  5.  *
  6.  * The use and distribution terms for this software are contained in the file
  7.  * named README, which can be found in the root of this distribution. By
  8.  * using this software in any fashion, you are agreeing to be bound by the
  9.  * terms of this license.
  10.  *
  11.  * You must not remove this notice, or any other, from this software.
  12.  */
  13.  
  14. #include "system.h"
  15. #include "game.h"
  16. #include "screens.h"
  17.  
  18. #include "draw.h"
  19. #include "control.h"
  20. #include "img.h"
  21.  
  22. #include "img_splash.e"
  23.  
  24. /*
  25.  * Display XRICK splash screen
  26.  *
  27.  * return: SCREEN_RUNNING, SCREEN_DONE, SCREEN_EXIT
  28.  */
  29. U8
  30. screen_xrick(void)
  31. {
  32.     static U8 seq = 0;
  33.     static U8 wait = 0;
  34.  
  35.     if (seq == 0) {
  36.         sysvid_clear();
  37.         draw_img(IMG_SPLASH);
  38.         game_rects = &draw_SCREENRECT;
  39.         seq = 1;
  40.     }
  41.  
  42.     switch (seq) {
  43.     case 1:  /* wait */
  44.         if (wait++ > 0x2) {
  45. #ifdef ENABLE_SOUND
  46.             game_setmusic("sounds/bullet.wav", 1);
  47. #endif
  48.             seq = 2;
  49.             wait = 0;
  50.         }
  51.         break;
  52.  
  53.     case 2:  /* wait */
  54.         if (wait++ > 0x20) {
  55.             seq = 99;
  56.             wait = 0;
  57.         }
  58.     }
  59.  
  60.     if (control_status & CONTROL_EXIT)  /* check for exit request */
  61.         return SCREEN_EXIT;
  62.  
  63.     if (seq == 99) {  /* we're done */
  64.         sysvid_clear();
  65.         sysvid_setGamePalette();
  66.         seq = 0;
  67.         return SCREEN_DONE;
  68.     }
  69.  
  70.     return SCREEN_RUNNING;
  71. }
  72.  
  73. /* eof */
  74.  
  75.